---
---
<!-- this URL: ce-ee-install-centos-prereq -->
<!-- title: CentOS: Installing Required Prequisite Software for Magento CE 1.8 Magento EE 1.13 (or Later) -->

<!DOCTYPE html>
<html lang=en>

<head>
	<meta charset=utf-8>

	<link rel="stylesheet" type="text/css" href="{{ site.baseurl }}/common/css/stylesheet.css"/>
	<link rel="stylesheet" href="{{ site.baseurl }}/common/css/stylesheet-fonts.css" type="text/css" charset="utf-8">
	<link rel="icon" href="{{ site.baseurl }}/common/css/favicon.ico" type="image/x-icon">
	<link rel="shortcut icon" href="{{ site.baseurl }}/common/css/favicon.ico" type="image/x-icon">
	<title>CentOS: Installing Required Prerequisite Software for Magento CE 1.8 Magento EE 1.13 (or Later)</title>

</head>

<body>
<a name="top"></a>
<img src="{{ site.baseurl }}/common/images/m1x/m1xheader.png" width="1024" alt="header" />


<h1>CentOS: Installing Required Prerequisite Software for Magento CE 1.8 Magento EE 1.13 (or Later)</h1>
<p><a href="{{ site.m1xgithuburl }}guides/m1x/install/installing_req-prereq_centos.html" target="_blank">Edit this page on GitHub <img src="{{ site.baseurl }}/common/images/github_icon.png" height="15px"></a></p>


<div id="content"> 

<div class="toc"> <h4 class="toc">Contents</h4>
<ul>
<li><a href="#overview">概述</a></li>
<li><a href="#update-system">Updating System Software</a></li>
<li><a href="#apache">Apache</a></li>
<li><a href="{{ site.m1xgdeurl }}install/nginx.html" target="_blank">nginx</a></li>
<li><a href="#php">PHP</a></li>
<li><a href="#mysql">MySQL</a></li>
<li><a href="#next">Next Steps</a></li>

</ul></div> 


<h2 id="overview">概述</h2>
<p>This article discusses how to install required prerequisite software for CentOS. You must complete these tasks before you install Magento CE 1.8或更新 or Magento EE 1.13或更新.</p>
<p>Before you continue, make sure you familiarize yourself with the installation process discussed in <a href="{{ site.m1xgdeurl }}install/installing_install.html#prereq">先决条件</a>.</p>
<div class="msg-box important"><img src="{{ site.baseurl }}/common/images/m1x/icon-note.png" alt="note" align="left" width="40"><span><strong>注意</strong>: You must install system software on CentOS as a user with <code>root</code> privileges.</div>


<h2 id="update-system">Updating System Software</h2>
<p>It's a good practice to update your repositories and optionally update system software.</p>
<p>Update repositories:</p>
<pre>yum -y update</pre>
<p>Optionally upgrade software. This might cause a system reboot.</p>
<pre>yum -y upgrade</pre>

<h2 id="apache">Apache</h2>
<p>Magento requires Apache use server rewrites. You must also specify the type of directives that can be used in <code>.htaccess</code>, which Magento uses to specify rewrite rules.</p>
<p>Installing and configuring Apache is basically a three-step process: install the software, enable rewrites, and specify <code>.htaccess</code> directives.</p>

<h3 id="apache-install">Installing Apache</h3>
<p>Install Apache 2 if you haven't already done so.</p>
<pre>yum -y install httpd</pre>

<h3 id="apache-rewrites">Enabling Apache Rewrites</h3>
<ol><li>Open <code>httpd.conf</code> for editing.
<pre>vim /etc/httpd/conf/httpd.conf</pre></li>
<li>Locate the block that starts with:
<pre>&lt;Directory /var/www/html></pre></li>
<li>In that block, change the value of <code>AllowOverride</code> to <code>All</code>.</li>
<li>Save your changes to <code>httpd.conf</code> and exit the text editor.</li>
<li>Restart Apache.
<pre>service httpd restart</pre></li></ol>

<h2 id="php">PHP</h2> 
<p>Magento CE and EE support the following PHP versions:</p>
<ul class="level1"><li>Magento CE 1.6.0.0&ndash;1.8.1.0 and Magento EE 1.11.0.0&ndash;1.13.1.0 support PHP 5.3 natively. They can be used with PHP 5.4 if you apply the <a href="{{ site.m1xgdeurl }}other/php5.4_patch.html" target="_blank">PHP 5.4 patch</a>.</li>
<li>Magento CE 1.9.0.x and EE 1.14.0.x support PHP 5.4 natively. They are backward-compatible with PHP 5.3</li>
<li>Magento CE 1.9.1 and EE 1.14.1 support PHP 5.5 natively. They are backward-compatible with PHP 5.4</li></ul>
<p>We recommend you use the most recent PHP version supported by your version of Magento. 例如， you should use PHP 5.5 with CE 1.9.1 or EE 1.14.1.</p>
<p>For more information about PHP, see:</p>
<ul class="level1"><li><a href="http://php.net/ChangeLog-5.php#5.4.0" target="_blank">PHP 5.4 changelog</a></li>
<li><a href="http://php.net/ChangeLog-5.php#5.5.0" target="_blank">PHP 5.5 changelog</a></li></ul>
<p>Check with a system administrator or reference for your version of CentOS to see what PHP versions are available.</p>
<p>If you're installing Magento CE 1.9.1 or Magento EE 1.14.1, you can use PHP 5.5; otherwise, we recommend PHP 5.4. For certain versions of CE and EE, a <a href="{{ site.m1xgdeurl }}other/php5.4_patch.html" target="_blank">patch</a> is required to use PHP 5.4.</p>
<p>Enter the following command to see what version of PHP is currently running:</p>
<pre>php -v</pre>
<p>See one of the following sections for more information:</p>
<ul class="level1"><li><a href="#php-upgrade">Upgrading PHP</a></li>
<li><a href="#php-extensions">Installing Required PHP Extensions</a></li>
<li><a href="#php-memory">Increasing the PHP memory Limit</a></li>
</ul>

<h3 id="php-upgrade">Upgrading PHP</h3>
<p>CentOS 6.x repositories have PHP 5.3. This section assumes you use either PHP 5.4 or 5.5. Make sure you understand which version of Magento CE or EE supports the PHP version to which you upgrade.</p>
<p>Before you start, verify you have PHP 5.3 installed:</p>
<pre>php -v</pre>
<p>If you already have the desired PHP version installed, you don't have to do anything.</p>
<p>If PHP is not installed, install PHP 5.3 using the following command:</p>
<pre>yum -y install php php-xml</pre>
<p>Continue with one of the following sections.</p>
<div class="msg-box important"><img src="{{ site.baseurl }}/common/images/m1x/icon-important.png" alt="important" align="left" width="40"><span><strong>Important</strong>: The following sections discuss <em>suggested</em> PHP upgrade paths. Because you're choosing a non-CentOS repository to upgrade PHP, make your choice carefully. Not all repositories work equally well. We don't recommend any particular repository. Consult a system administrator or CentOS reference for more information.</span></div>


<h4 id="php-upgrade55">Upgrading to PHP 5.5</h4>
<p>There is more than one way to upgrade CentOS 6.5 to PHP 5.5; the following is a suggestion only. Consult a reference for additional options.</p>
<p>Enter the following commands in the order shown.</p>
<pre>cd /tmp
rpm -Uvh https://mirror.webtatic.com/yum/el6/latest.rpm
yum -y remove php-common-5.3.3-40.el6_6.x86_64
yum -y install php55w php55w-opcache</pre>
<p>Skip the next section and continue with <a href="#php-extensions">Installing Required PHP Extensions</a>.</p>

<h4 id="php-upgrade54">Upgrading to PHP 5.4</h4>
<p>Enter the following commands to upgrade to PHP 5.4:</p>
<pre>cd /tmp
rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
yum --enablerepo=remi install httpd php php-common</pre>
<p>The following resources are also available:</p>
<ul><li><a href="http://kb.parallels.com/en/115875" target="_blank">kb.parallels</li>
<li><a href="http://stackoverflow.com/questions/21502656/upgrading-php-on-centos-6-5-final" target="_blank">stackoverflow</a></li>
<li><a href="http://rpms.famillecollet.com/" target="_blank">remi repository</a></li></ul>

<h3 id="php-extensions">Installing Required PHP Extensions</h3>
<p>The names of the PHP extensions you must install depend on the repository from which you installed PHP. Use one of the following commands:</p>
<p>PHP 5.5:</p>
<pre>yum -y install php55w-xml php55w-mcrypt php55w-gd php55w-devel php55w-mysql php55w-mbstring</pre>
<p>PHP 5.4:</p>
<pre>yum -y install --enablerepo=remi php-mcrypt gd gd-devel php-gd php-mysql php54w-mbstring</pre>

<h3 id="php-memory">Increasing the PHP Memory Limit</h3>
<p>Increase <code>memory_limit</code> in <code>php.ini</code> to at least 512MB.</p>
<ol><li>Open <code>/etc/php.ini</code> in a text editor.</li>
<li>Change <code>memory_limit</code> to:
<pre>memory_limit = 512M</pre></li>
<li>Save your changes and exit the text editor.</li></ol>

<h2 id="mysql">MySQL</h2>
<p>This section discusses how to install and configure MySQL 5.6. CentOS 6.x repositories have MySQL 5.1; to install a different version of MySQL, see the <a href="http://dev.mysql.com/doc/index.html" target="_blank">MySQL documentation</a>.</p>
<div class="msg-box important"><img src="{{ site.baseurl }}/common/images/m1x/icon-note.png" alt="note" align="left" width="40"><span><strong>注意</strong>: Use the tasks that follow only on a <em>new MySQL database</em>. Some of the tasks require you to delete users and should not be performed on a database that has already been set up.</div>

<p>The following procedure is based on <a href="http://sharadchhetri.com/2013/12/26/install-mysql-server-5-6-in-centos-6-x-and-red-hat-6-x-linux/" target="_blank">Install MySQL Server 5.6 in CentOS 6.x and Red Hat 6.x Linux</a>.</p>
<ol><li>Install the MySQL database:
<pre>cd /tmp
wget http://repo.mysql.com/mysql-community-release-el6-5.noarch.rpm
rpm -ivh mysql-community-release-el6-5.noarch.rpm
yum -y install mysql-server</pre></li>
<li>Start MySQL.
<pre>service mysqld start</pre>
<li>Set a password for the <code>root</code> user and set other security-related options. Enter the following command and follow the prompts on your screen to complete the configuration.
<pre>mysql_secure_installation</pre></li>

</ol>

<h2 id="next">Next Steps</h2>
<p>After installing the required prerequisite software, continue your installation with <a href="{{ site.m1xgdeurl }}install/installing_install.html#prepare">Preparing Your Server for Magento CE or EE</a>.</p>
</body>
</html>